package com.sofwin.system.service.impl;

import com.sofwin.pojo.SysRoleMenuExample;
import com.sofwin.system.mapper.SysRoleMenuMapper;
import com.sofwin.system.service.RoleMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;

/**
 * @packageName: com.sofwin.system.service.impl
 * @user: andyliu
 * @date: 2021/12/17 10:19
 * @email 115176513@qq.com
 * @description: TODO
 */
@Service
public class RoleMenuServiceImpl implements RoleMenuService {
    @Autowired
    private SysRoleMenuMapper menuMapper;
    @Override
    public boolean deleteRoleMenus(Integer roleId) {
        SysRoleMenuExample ex = new SysRoleMenuExample();
        SysRoleMenuExample.Criteria criteria = ex.createCriteria();
        criteria.andRoleIdEqualTo(roleId);
        int a = menuMapper.deleteByExample(ex);

        return a>0?true:false;
    }
}
